import request from '@/utils/request'
//1、查询所有商品规格数据
export const GetAllProductSpec = () => {
  return request({
    url: `/admin/product/spec/list`,
    method: 'GET',
  })
}
// 2、查询商品规格分页数据
export const GetProductSpecs = (pageNum, pageSize) => {
  return request({
    url: `/admin/product/spec/list/${pageNum}/${pageSize}`,
    method: 'GET',
  })
}
// 3、id查询商品规格
export const GetProductSpecById = id => {
  return request({
    url: `/admin/product/spec/getById/${id}`,
    method: 'GET',
  })
}
// 4、更新商品规格
export const UpdateProductSpec = spec => {
  return request({
    url: `/admin/product/spec/update`,
    method: 'PUT',
    data: spec,
  })
}
// 5、根据id删除商品规格
export const DeleteProductSpec = id => {
  return request({
    url: `/admin/product/spec/delete/${id}`,
    method: 'DELETE',
  })
}
// 6、新增商品规格
export const SaveProductSpec = spec => {
  return request({
    url: `/admin/product/spec/save`,
    method: 'POST',
    data: spec,
  })
}
